{include file="$usertemplate/header.tpl.html" title=header} 
    	<div class="content">
   			{include file="$usertemplate/left.tpl.html" title=left} 
        	<div class="cont_right">
           		<div class="main_content">
                	<h2>Giỏ hàng của bạn</h2>
                    <div class="details">
                         {literal}
						<script type="text/javascript" language="javascript">
							$(".capnhat a").click(function(){
								$("#frmBooking").submit();
							});
							$('.xoasp input[type=checkbox]').click(function(){
								$("#frmBooking").submit();
							});

						</script>
                        {/literal}
                        {if $cartItems}
                        <form name="frmBooking" id="frmBooking" action="" method="post">
                        <div class="giohang">
                            <div class="tt-ctgh">
                                <ul>
                                    <li class="tensp"><p>Tên sản phẩm</p></li>
                                    <li class="sluong"><p>Số lượng</p></li>
                                    <li class="gtien"><p>Giá tiền</p></li>
                                    <li class="ttien"><p>Tổng tiền</p></li>
                                    <li class="xoasp"><p>Xóa</p></li>
                                </ul>
                            </div><!--tt-ctgh-->
                            <div class="cc-ctgh">
                                
                                {foreach from=$cartItems item=cartItem}
                                <div class="dong-chitiet">
                                    <ul>
                                        <li class="tensp"><p>{$cartItem->getProductName()}</p></li>
                                        <li class="sluong" style="text-align:center;">
                                            <input type="hidden" name="cIds[]" value="{$cartItem->getId()}" />
                                            <input type="text" name="quantity[]" value="{$cartItem->getQuantity()}" style="width:20px; height:20px; margin-top:10px;"/>
                                        </li>
                                        <li class="gtien"><span>{$cartItem->getPrice()|number_format:0:",":"."} {$messages.currency}</span></li>
                                        <li class="ttien">
                                        {assign var=price value=$cartItem->getPrice()}
                                        {assign var=quantity value=$cartItem->getQuantity()}
                                        {assign var=subTotal value=$price*$quantity}
                                        {assign var=grandTotal value=$grandTotal+$subTotal}
                                        <span>{$subTotal|number_format:0:",":"."} {$messages.currency}</span>
                                        </li>
                                        <li class="xoasp" style="text-align:center;">
                                            <input type="checkbox" name="dIds[]" value="{$cartItem->getId()}" style="margin-top:10px;"/>
                                            <input type="hidden" name="op" value="shopping" />
                                            <input type="hidden" name="plus" value="updateCart" />
                                            <input type="hidden" name="lang" value="{$lang}" />                    
                                        </li>
                                    </ul>
                                </div><!--dong-chitiet-->
                                {/foreach}
                                <div class="tongtientinh">
                                    <ul>
                                        <li class="tttt"><p>Tổng tiền cần thanh toán:</p></li>
                                        <li class="cccc"><span>{$grandTotal|number_format:0:",":"."} {$messages.currency}</span></li>
                                    </ul>
                                </div><!--tongtientinh-->
                                <div class="nutnut">
                                    <ul>
                                        <li class="capnhat"><a href="javascript:;"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-capnhat.jpg" /></a></li>                                    
                                        <li class="tieptuc">
                                            {if $procatId}
                                            {assign var=procatSlug value=$productcategories->getProCate('slug', "id = $category")}
                                                <a href="{$url->getLink('products', $lang, $procatSlug, $procatId)}" title="{$messages.continue}"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-tieptucmuahang.jpg" /></a>
                                            {else}
                                                <a href="{$ROOTPATH}/san-pham.html" title="{$messages.continue}"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-tieptucmuahang.jpg" /></a>
                                            {/if}
                                        </li>
                                        <li class="thanhtoan"><a href="{$ROOTPATH}/order.html"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-thanhtoan.jpg" /></a></li>
                                        <!--<li class="guidon"><a href="#"><img src="{$ROOTPATH}/templates/{$usertemplate}/images/nut-guidon.jpg" /></a></li>-->
                                    </ul>
                                </div><!--nutnut-->
                            </div><!--cc-ctgh-->
                        </div><!--giohang-->
                        </form>
                        {else}
                        <div class="giohang" style="text-align:center; padding:10px 0px;">
                            Chưa có sản phẩm nào trong giỏ hàng của bạn. Click vào <a href="{$ROOTPATH}/san-pham.html">đây</a> để tiếp tục mua hàng
                        </div>
                        {/if}
                    </div>
                </div>
  			 </div>
   		</div>
{include file="$usertemplate/footer.tpl.html" title=footer} 